﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/App_Layouts/Default.master" CodeFile="Default.aspx.cs" Inherits="Admin_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Main" Runat="server">
    
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    
    <div class="page" id="regular">
    
            <h3>Administracija</h3>
            <p></p>
            <asp:Label ID="lblDobrodosli" runat="server"></asp:Label>
            <br /><br />
            
        <cc1:TabContainer ID="TabContainer1" runat="server">
            <cc1:TabPanel ID="tpKorisnici" HeaderText="Korisnici" runat="server">
                <ContentTemplate>
                    
                    Korisnici<br /><br />
                    <asp:GridView ID="gvKorisnici" DataKeyNames="Id" PageSize="20" AutoGenerateColumns="false"
                    AllowPaging="true" AllowSorting="true" runat="server" EmptyDataText="Nema korisnika" ShowFooter="true"
                    OnRowDataBound="GridViewKorisnici_RowDataBound"
                    OnRowCommand="GridViewKorisnici_RowCommand"
                    OnRowDeleting="GridViewKorisnici_OnRowDeleting" 
                    OnRowEditing="GridViewKorisnici_OnRowEditing" 
                    OnRowCancelingEdit="GridViewKorisnici_OnRowCancelingEdit"
                    OnRowUpdating="GridViewKorisnici_OnRowUpdating">
                    <Columns>
                        <asp:TemplateField HeaderText="Id" Visible="false">
                            <EditItemTemplate>
                                <asp:Label ID="lblId" runat="server" Text='<%# Bind("Id") %>'></asp:Label>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblId" runat="server" Text='<%# Bind("Id") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Ime">
                            <EditItemTemplate>
                                <asp:TextBox Width="90" ID="tbIme" runat="server" Text='<%# Bind("Ime") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblIme" runat="server" Text='<%# Bind("Ime") %>'></asp:Label>
                            </ItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox Width="90" ID="tbNovoIme" runat="server"></asp:TextBox>
                            </FooterTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Prezime">
                            <EditItemTemplate>
                                <asp:TextBox Width="90" ID="tbPrezime" runat="server" Text='<%# Bind("Prezime") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblPrezime" runat="server" Text='<%# Bind("Prezime") %>'></asp:Label>
                            </ItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox Width="90" ID="tbNovoPrezime" runat="server"></asp:TextBox>
                            </FooterTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Korisnicko ime">
                            <EditItemTemplate>
                                <asp:TextBox Width="90" ID="tbKorisnickoIme" runat="server" Text='<%# Bind("KorisnickoIme") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblKorisnickoIme" runat="server" Text='<%# Bind("KorisnickoIme") %>'></asp:Label>
                            </ItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox Width="90" ID="tbNovoKorisnickoIme" runat="server"></asp:TextBox>
                            </FooterTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Lozinka">
                            <EditItemTemplate>
                                <asp:TextBox Width="90" ID="tbLozinka" runat="server" Text='<%# Bind("Lozinka") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblLozinka" runat="server" Text='<%# Bind("Lozinka") %>'></asp:Label>
                            </ItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox Width="90" ID="tbNovaLozinka" runat="server"></asp:TextBox>
                            </FooterTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Email">
                            <EditItemTemplate>
                                <asp:TextBox ID="tbEmail" runat="server" Text='<%# Bind("Email") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblEmail" runat="server" Text='<%# Bind("Email") %>'></asp:Label>
                            </ItemTemplate>
                            <FooterTemplate>
                                <asp:TextBox ID="tbNoviEmail" runat="server"></asp:TextBox>
                            </FooterTemplate>
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="Izmeni" ShowHeader="false">
                            <EditItemTemplate>
                                <asp:LinkButton ID="lbkIzmeni" runat="server" CausesValidation="true" CommandName="Update" Text="Izmeni"></asp:LinkButton>
                                <asp:LinkButton ID="lbkOtkazi" runat="server" CausesValidation="true" CommandName="Cancel" Text="Otkazi"></asp:LinkButton>
                            </EditItemTemplate>
                            <FooterTemplate> 
                                <asp:LinkButton ID="lnkDodaj" runat="server" CausesValidation="False" CommandName="Dodaj" Text="Dodaj"></asp:LinkButton> 
                            </FooterTemplate> 
                            <ItemTemplate> 
                                <asp:LinkButton ID="lnkIzmeni" runat="server" CommandArgument='<%# Eval("Id") %>' CausesValidation="False" CommandName="Edit" Text="Izmeni"></asp:LinkButton> 
                                <asp:LinkButton ID="lbkSelect" runat="server" CommandArgument='<%# Eval("Id") %>' CausesValidation="true" CommandName="Select" Text="Select"></asp:LinkButton>
                            </ItemTemplate> 
                        </asp:TemplateField>
                        
                        <asp:CommandField HeaderText="Obrisi" ShowDeleteButton="True" ShowHeader="True" /> 
                    </Columns>
                    </asp:GridView>
                    
                </ContentTemplate>
            </cc1:TabPanel>
            <cc1:TabPanel ID="tpLinkovi" HeaderText="Linkovi" runat="server">
                <ContentTemplate>
                    Linkovi
                </ContentTemplate>
            </cc1:TabPanel>
        </cc1:TabContainer>            

    </div>

</asp:Content>